<?php
    if(!empty($contasReceberVencidas)): ?>
    <thead>
    <tr>
        <th class="col-md-9 vert-align">LANÇAMENTO</th>
        <th class="col-md-1 vert-align text-left">DATA</th>
        <th class="col-md-2 text-center">OPÇÕES</th>
    </tr>
    </thead>
    <tbody>
    <?php foreach($contasPagarVencidas as $contaPagar): ?>
        <td class="vert-align">
            <div class="ckbox ckbox-default">
                <input type="checkbox" onchange="somarValor(this)" name="conta_<?php echo $contaPagar['PayReceive']['id'] ?>" value="<?php echo $contaPagar['PayReceive']['id'] ?>" data-value="<?php echo $contaPagar['PayReceive']['valor_doc'] ?>" id="<?php echo $contaPagar['PayReceive']['id'] ?>" class="sa-chk-ContasPagar-valorConta" />
                <label for="<?php echo $contaPagar['PayReceive']['id'] ?>"><?php echo $contaPagar['Account']['name'] ?> - R$ <?php echo $this->Func->money($contaPagar['PayReceive']['valor_doc']) ?> - <?php echo $contaPagar['PayReceive']['descricao'] ?></label>
            </div>
        </td>
        <td class="vert-align text-left">
            <label for="<?php echo $contaPagar['PayReceive']['id'] ?>" class="label label-<?php echo $this->Func->ativaContaVencida($contaPagar['PayReceive']['data_vencimento'],$contaPagar['PayReceive']['data_pagamento']); ?>"><?php echo $this->Func->DateFormat(array('date'=>$contaPagar['PayReceive']['data_vencimento'],'type'=>'2','time'=>false)); ?></label>
        </td>
        <td class="vert-align text-center">
            <div class="btn-group nomargin">

                <?php echo $this->Func->btnPagar(array('id'=>$contaPagar['PayReceive']['id'],'Mes'=>$Mes),$contaPagar['PayReceive']['data_pagamento']); ?>

                <?php if($contaPagar['PayReceive']['data_pagamento'] == null): ?>
                    <?php echo $this->Html->link('<i class="fa fa-pencil"></i>','javascript:;',array("class"=>"btn btn-white btn-xs",'escape'=>false,"title"=>"Editar Registro",'onclick'=>'editContaPagar('.$contaPagar['PayReceive']['id'].')')); ?>

                    <?php echo $this->Form->postLink('<i class="fa fa-trash-o"></i>', array('action' => 'delete', $contaPagar['PayReceive']['id']), array('escape'=>false,"title"=>"Excluir","class"=>"btn btn-danger btn-xs"), __('Deseja realmente excluir este lançamento# %s?', $contaPagar['Account']['name'])); ?>
                <?php endif; ?>
            </div>
        </td>
        </tr>
    <?php endforeach; ?>
    </tbody>
<?php else: ?>
    <tr>
        <td>
            <div class="alert alert-info mb5">
                <strong>INFORMÇÃO:&nbsp;</strong><span>Não foi encontrado resultado para o mês:  <strong><?php echo $Mes."/".$Ano ?></strong></span>
            </div>
        </td>
    </tr>
<?php endif; ?>